#include<stdio.h> 

int ispime(int n){
	int f=2;
	while (f<=n-1){
		if (n%f!=0){
			f++;
		}
		else{
			return 0;
		}
	}
	return 1;
}

int main(){
	int m;
	while(1){
		scanf("%d",&m);
		if (m==0){
			break;
		}
		else{
			if(ispime(m)){
				printf("%4d is prime.\n",m);
			}
			else{
				printf("%4d is not prime.\n",m);
			}
		}	
	}
}
